package com.emellend.api.s;

import com.emellend.api.R;
import android.app.Activity;
import android.os.Bundle;
import android.widget.SeekBar;
import android.widget.SeekBar.OnSeekBarChangeListener;
import android.widget.TextView;
/**
 * seekbar监听的应用
 * @author tiangh
 *
 */
public class SeekBar1 extends Activity implements OnSeekBarChangeListener {

	private SeekBar mSeekBar;
	private TextView mProgressText;
	private TextView mTrackingText;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.seekbar_1);
		init();
	}
	
	private void init() {
		mSeekBar = (SeekBar) this.findViewById(R.id.seek);
		mSeekBar.setOnSeekBarChangeListener(this);
		mProgressText = (TextView) this.findViewById(R.id.progress);
		mTrackingText = (TextView) this.findViewById(R.id.tracking);
	}
	public void onProgressChanged(SeekBar seekBar, int progress,
			boolean fromUser) {
		mProgressText.setText("Seek="+progress+",fromUser"+fromUser);
	}

	public void onStartTrackingTouch(SeekBar seekBar) {
		mTrackingText.setText("tracking_on");
	}

	public void onStopTrackingTouch(SeekBar seekBar) {
		mTrackingText.setText("tracking_off");
	}

}
